package com.java.huxb.controller;

import com.java.huxb.entity.Order;
import com.java.huxb.producer.RabbitSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huxb
 * @date 2020/2/3 0003 下午 3:30
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
     private RabbitSender rabbitSender;

    @RequestMapping("/{id}")
    public String test(@PathVariable("id")String id) throws Exception {
        Order order = new Order(id, "这是订单号" + id);
        rabbitSender.setStaff(order);
        return "test" + id;
    }
}
